package ferp.core.state;

import ferp.core.game.Game;
import ferp.core.game.Input;
import ferp.core.game.Settings;
import ferp.core.player.Profile;

/**
 * User: olegs
 * Date: 11/21/13 12:15 PM
 */
public class Score extends State
{
  @Override
  public int process(Game.Listener listener, Profile profile, Game g, Settings settings, Input input) throws Game.Error
  {
    // calculate set's score depending on the actual mode
    g.mode().score(g, settings);

    // switch to "ended" mode
    g.end();

    // save the current state
    save(profile);

    return Result.SCHEDULE;
  }
}
